
$(document).ready(function() {
});

function editCT(idphieu, url)
{
	url = url + "&idPhieu=" + encodeURIComponent(idphieu);
	location.href = url;
	//var win = window.open(url, '_blank');

}

function deleCT(journalid,xNam, soct, idphieu, urlDel, url)
{
	if (!confirm('Ban muon xoa chung tu  '+ soct+' ?')) {
		return;
	} 

	jQuery.ajax({
       type: "POST",
       url: urlDel,
	   data: {journalid: journalid, year: xNam, idphieu: idphieu},
       cache: false,
       success: function(response)
       {
		   if (response.substring(0,1) == 1)
		   {
			  alert("Da xoa xong!");
		   }
		   else
		   {
		   alert("Co loi du lieu, khong xoa duoc!\n"+response);
		   }
       },
	
	   error: function(data, errorThrown)
	  {
		  alert('request failed :'+errorThrown);
	  }
     });


	location.href = url;


}

function Ret(url)
{
	var Nam=document.getElementById('ttNam').innerHTML;
	url = url + "?Nam="+Nam;
	location.href = url;
	//var win = window.open(url, '_blank');

}

